import type { AxiosOption } from "../../types"


export function xhrAdapter(option:AxiosOption) {
  return new Promise((resolve, reject)=>{
    const xhr = new XMLHttpRequest()

    xhr.open('get', '')

    if(option.cancelToken) {
      option.cancelToken.promise.then(()=>{
        xhr.abort()
      })
    }
    
    xhr.send()

  })
}
